﻿//--------------------------------------
// Copyright     : W.A.I.S. TECHNOLOGY 2003-2008 ; http://www.wais-fr.com ; email: infos@wais-fr.com
// Author        : Henri d'Orgeval
// Contributors  : 
// Last release  : 2007/10/29 (yy/mm/dd)
// Version       : 1.0.0.1
// Pattern       : "Real Time Trace"
// Internal name : TraceDataProviderFactory.vb (RealTimeTrace Factory that handles the data access layer)
// Description   : this class contains all Factories needed to implement RealTimeTrace data access layer.
//                 
// Framework     : v2.0.50727 and above
//
// Licence       : Microsoft Permisse Licence
// W.A.I.S provides this code in the hope that it will be useful, but WITHOUT ANY WARRANTY , either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.          
// This library is free software; you can redistribute it and/or modify it under the terms of the Microsoft Permissive Licence
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//---------------------------------------

using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;

namespace RealtimeTrace
{
    /// <summary>
    /// RealTimeTrace Data provider factory.
    /// </summary>
    internal sealed class TraceDataProviderFactory
    {
        /// <summary>
        /// Creates and returns an instance of RealtimeTrace Data Provider.
        /// </summary>
        /// <param name="providerType">Type of the provider to be returned</param>
        /// <returns></returns>
        internal static ITraceDataProvider CreateDataProvider(RealtimeTrace.DataProviderType providerType)
        {
            try
            {
                if (providerType == DataProviderType.None)
                {
                    return null;
                }

                // by default return a LogfileDataProvider
                TraceLogFileProvider myDefaultProvider = new TraceLogFileProvider();
                return myDefaultProvider;
            }
            catch (Exception)
            {
                return null;
            }
        }

        /// <summary>
        /// Makes the default constructor private.
        /// So that this Factory cannot be instanciated.
        /// </summary>
        private TraceDataProviderFactory()
        {

        }
    
    }
}
